package com.ws.soa.consumer.common.enums;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * @author Neo
 * @email Lihai.Ge@geely.com
 * @date 2019/3/9
 */
public enum SmsCodeEnum {

    SEND_SMS("SMS_133865141", "验证码");
    
    private String code;

    private String desc;

    SmsCodeEnum( String code, String desc) {
        this.desc = desc;
        this.code = code;
    }

    public static final SmsCodeEnum getStatusByCode(int code) {
        SmsCodeEnum bizEnum = enumMap.get(code);
        if (null != bizEnum) {
            return bizEnum;
        }
        return null;
    }

    private static Map<String, SmsCodeEnum> enumMap = null;

    static {
        Map<String, SmsCodeEnum> tempMap = new HashMap<String, SmsCodeEnum>();

        for (SmsCodeEnum item : SmsCodeEnum.values()) {
            tempMap.put(item.getCode(), item);
        }
        enumMap = Collections.unmodifiableMap(tempMap);
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
